package com.dcits.electronic_account.mapper;

import com.dcits.electronic_account.bean.BingBank;
import com.dcits.electronic_account.bean.Flow;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface WithdrawalMapper {
    //校验登录
    public int check_login_state(@Param("user_id") String id);
    //绑定银行卡
    public List<BingBank> checkBingBankCard(@Param("user_id") String id);
    //校验账户密码
    public String checkBankCardAndPassword(@Param("bank_card_number") String bankCardNumber,@Param("password") String password);
    //提现
    public int withdrawal(@Param("bank_card_number") String bankCardNumber,@Param("balance") BigDecimal balance,@Param("user_id") String id);
    //校验金额
    public int check_balance(@Param("bank_card_number") String bank_card_number,@Param("balance") BigDecimal balance);
    //流水
    public void insert_flow(@Param("flow") Flow flow_account);
    //查询流水id
    public int select_fid();
    //金额变动
    public int change_balance(@Param("add_balance") BigDecimal add,@Param("reduce_balance") BigDecimal reduce,@Param("bank_card_number") String bank_card_number);
}
